package com.project.service.reviewService.impl;

import com.project.bean.ReviewBean;
import com.project.mapper.reviewMapper.IReviewMapper;
import com.project.service.reviewService.IReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ReviewServiceImpl implements IReviewService {
    @Autowired
    private IReviewMapper reviewMapper;


    @Override
    public void addGoodsReview(ReviewBean review, int goodsId) {
        reviewMapper.addGoodsReview(review, goodsId);
    }

    @Override
    public void addServeReview(ReviewBean review, int serveId) {
        reviewMapper.addServeReview(review, serveId);
    }

    @Override
    public List<ReviewBean> findByGoodsId(int goodsId) {
        return reviewMapper.findByGoodsId(goodsId);
    }

    @Override
    public List<ReviewBean> findByServeId(int serveId) {
        return reviewMapper.findByServeId(serveId);
    }
}
